{% extends "member/member_base.html" %}
{% block style %}

        input[type='number']{
            width: 100px;
        }
        .btn{
            margin-right: 30px;

        }
{% endblock %}
{% block content %}

		<div class="container-fluid">
			<div class="row">

				<div class="col-md-12">
					<!-- 媒体列表 -->
                    <h3>文章管理

                    <small>
                            <a href="{{ url_for("member_app.article_post") }}">
                                添加文章
                            </a>
                        </small>
                    </h3>
                    <div class="panel">
                        <form action=""  method="post" class="form-horizontal" >
                            {{ form.csrf_token }}
                            <div class="form-group">
                                <label for="q" class="col-xs-2 control-label">{{ form.q.label.text }}</label>
                                <div class="col-xs-10">
                                   {{ form.q }}
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="field" class="col-xs-2 control-label">{{ form.field.label.text }}</label>
                                <div class="col-xs-10">
                                    {{ form.field }}
                                </div>
                            </div>


                            <div class="form-group">
                                <label for="排序" class="col-xs-2 control-label">{{ form.order.label.text }}</label>
                                <div class="col-xs-2">
                                   {{ form.order }}
                                </div>
                            </div>

                            <div class="form-group ">

                                <input type="submit" name="search" class="btn btn-primary pull-right" value="立即搜索">
                            </div>

                        </form>
                    </div>
                    <table class="table">
                        <tr>
                            <td>总页数:{{ pages }}/总记录:{{ total }}</td>
                        </tr>
                    </table>
					<table class="table table-bordered ">

                        <tr>
                            <th>文章ID</th>
                            <th>文章标题</th>
                            <th>作者</th>
                            <th>发布日期</th>
                            <th>操作</th>
                        </tr>
                        {% for article in articles %}
                        <tr>
                            <td>{{ article.id }}</td>
                            <td><a href="{{ url_for("article_app.view", article_id=article.id) }}">{{ article.title }}</a></td>
                            <td>{{ article.author }}</td>
                            <td>{{ article.pubdate }}</td>
                            <td>
                                <a href="javascript:open('{{ url_for("member_app.article_edit", article_id=article.id) }}')">修改</a>
                                <a href="{{ url_for("member_app.article_delete", article_id=article.id) }}">删除</a>
                            </td>
                        </tr>
                        {% endfor %}
                    </table>
					<!--  -->
					<ul class="pagination">
                        {% for page in pageList %}
                            {% if page!=None %}
						<li><a href="{{ url_for("member_app.article_list", page=page) }}">{{ page }}</a></li>
                            {% else %}
                            <li><a href="#">...</a></li>
                            {% endif %}
						{% endfor %}
					</ul>
				</div>


				</div>
			</div>
		</div>
{% endblock %}

